﻿namespace Oplug.EntityFramework.RossLive
{
    using System.Data.Entity;

    public partial class OplugLiveDbContext : DbContext
    {
        public OplugLiveDbContext(string ConnStr)
            : base(ConnStr)
        {
            Database.SetInitializer<OplugLiveDbContext>(null);
        }
        public OplugLiveDbContext()
            :base("name=RossLive")
        {
            //策略一：数据库不存在时重新创建数据库
            Database.SetInitializer<OplugLiveDbContext>(new CreateDatabaseIfNotExists<OplugLiveDbContext>());
            //策略二：每次启动应用程序时创建数据库
            //Database.SetInitializer<RossLiveDbContext>(new DropCreateDatabaseAlways<RossLiveDbContext>());
            //策略三：模型更改时重新创建数据库
            //Database.SetInitializer<RossLiveDbContext>(new DropCreateDatabaseIfModelChanges<RossLiveDbContext>());
            //策略四：从不创建数据库
            //Database.SetInitializer<RossLiveDbContext>(null);
        }      
        public virtual IDbSet<RossConfig> RossConfig { get; set; }
        public virtual IDbSet<RossPowers> RossPowers { get; set; }
        public virtual IDbSet<RossUsers> RossUsers { get; set; }
        public virtual IDbSet<UpdateLogs> UpdateLogs { get; set; }
        public virtual IDbSet<DataCode> DataCode { get; set; }
        public virtual IDbSet<Employee> Employee { get; set; }
        public virtual IDbSet<DataSQL> DataSQL { get; set; }
        public virtual IDbSet<Tasks> Tasks { get; set; }
        public virtual IDbSet<Departments> Departments { get; set; }
        public virtual IDbSet<FormMethods> FormMethods { get; set; }
        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            
        }
    }
}
